﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Basics
{
    class Camera2D
    {
        public Vector2 Position { get; set; }
        private WorldObject focused;
        public bool IsFocused { get; set; }

        public Camera2D(Vector2 position)
        {
            this.Position = position;
            this.focused = null;
            this.IsFocused = false;
        }

        public void FocusOn(WorldObject worldObject)
        {
            this.focused = worldObject;
            this.IsFocused = true;
        }

        public void Update(GameTime gameTime)
        {
            if (this.IsFocused)
            {
                this.Position = this.focused.Position;
            }
        }
    }
}
